﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace ClientExample.Controls
{
    public partial class ConnectionIndication : UserControl
    {
        public ConnectionIndication()
        {
            InitializeComponent();

            btnInternet.MouseEnter += new EventHandler(OnMouseEnter);
            btnLoopback.MouseEnter += new EventHandler(OnMouseEnter);
            btnNAT.MouseEnter += new EventHandler(OnMouseEnter);
            btnPublicIP.MouseEnter += new EventHandler(OnMouseEnter);
            btnUPnP.MouseEnter += new EventHandler(OnMouseEnter);
        }

        void OnMouseEnter(object sender, EventArgs e)
        {
            Control control = sender as Control;
            if (control != null)
            {
                string msg = string.Empty;
                if (control.Equals(btnInternet))
                    msg = "If text is green, Xmpl is able to access www.google.com";
                else if (control.Equals(btnLoopback))
                    msg = "If text is green, Xmpl is able to receive messages localy";
                else if (control.Equals(btnNAT))
                    msg = "If text is green, Xmpl seem to have the access it needs to function properly";
                else if (control.Equals(btnPublicIP))
                    msg = "If text is green, Xmpl was able to get your public IP";
                else if (control.Equals(btnUPnP))
                    msg = "If text is green, your router has support for portforwarding through UPnP";
                toolTip1.SetToolTip(control, msg);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}
